<template>
  <view class="weather_container">
    <view class="today_weather">
      <button @click="getLocation()">获取位置</button>
    </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        address:""
      }
    },
    methods: {
      getLocation(){
        wx.choosePoi({
          success (res) {
            this.address = res.address
          },
          fail(err) {
            console.log("位置出错了",err);
          }
        })
      }
    }
  }
</script>

<style lang="less" scoped>
.weather_container{
  .today_weather{
    width: 100%;
    height: 800rpx;
    border: 1px solid red;
    padding-top: 100rpx;
    box-sizing: border-box;
  }
  
}
</style>
